//
//  SGUMOnlineConfig.m
//  EatNumber
//
//  Created by zg.shao on 15/1/17.
//  Copyright (c) 2015年 kuwo.cn. All rights reserved.
//

#import "SGUMOnlineConfig.h"
#import "MobClick.h"

// 友盟在线参数更新的key
#define UMOnlineConfigKey_EnableShare       @"EnableShareV2.0"
#define UMOnlineConfigKey_ShareUrl          @"ShareUrl"
#define UMOnlineConfigKey_ShareTitle        @"ShareTitle"
#define UMOnlineConfigKey_ShareDesc         @"ShareDesc"

@implementation SGUMOnlineConfig

+ (BOOL)enableShare {
    NSString *value = [MobClick getConfigParams:UMOnlineConfigKey_EnableShare];
    if (value && ([[value uppercaseString] isEqualToString:@"YES"] || [[value uppercaseString] isEqualToString:@"TRUE"] || [value isEqualToString:@"1"])) {
        return YES;
    }
    
    return NO;
}

+ (NSString *)shareUrl {
    NSString *value = [MobClick getConfigParams:UMOnlineConfigKey_ShareUrl];
    if ([value length] > 0) {
        return value;
    }
    
    value = @"https://itunes.apple.com/cn/app/chi-shu-zi-shu-zi-you-xi-zhong/id956381571?mt=8";
    return value;
}

+ (NSString *)shareTitle {
    NSString *title = [MobClick getConfigParams:UMOnlineConfigKey_ShareTitle];
    
    if ([title length] > 0) {
        return title;
    }
    
    return @"超级好玩的游戏!";
}

+ (NSString *)shareDesc {
    NSString *desc = [MobClick getConfigParams:UMOnlineConfigKey_ShareDesc];
    
    if ([desc length] > 0) {
        return desc;
    }
    
    return @"我发现了一个比2048还要还玩的游戏，快来玩吧!";
}

@end
